#pragma once


namespace MemMgr
{

template<class T> class STDAllocator 
{
public:

	typedef T         value_type;
	typedef size_t    size_type;
	typedef ptrdiff_t difference_type;
	typedef T*        pointer;
	typedef const T*  const_pointer;
	typedef T&        reference;
	typedef const T&  const_reference;


	inline STDAllocator() throw()
	{
	}


	STDAllocator(const STDAllocator& iOther) throw() 
	{
	}


	template<class U> STDAllocator(const STDAllocator<U>& iOther) throw() 
	{
	}


	~STDAllocator() throw() 
	{

	}


	template<class U> struct rebind 
	{
		typedef STDAllocator<U> other;
	};



	pointer address(reference iRef) const
	{
		return &iRef;
	}


	const_pointer address(const_reference iRef) const
	{
		return &iRef;
	}


	size_type max_size() const throw()
	{
		return ~size_t(0) / sizeof(value_type);
	}


	pointer allocate(size_type iNum, const void* iHint = 0)
	{
		return reinterpret_cast<pointer>(MM_MALLOC(sizeof(value_type) * iNum);
	}


	void deallocate(pointer iPtr, size_type) 
	{
		MM_FREE(iPtr);
	}


	void construct(pointer iPtr, const_reference iVal) 
	{
		new(p) value_type(iVal);
	}


	void destroy(pointer iPtr) 
	{
		iPtr->~value_type();
	}
};

}